package com.evergrande.mybatis.service.impl;

import com.evergrande.mybatis.model.NavTreeDto;
import com.evergrande.mybatis.service.NavTreeDtoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * Created by cuican on 2016-8-17.
 */
@Service("navTreeDtoService")
public class NavTreeDtoServiceImpl extends BaseService<NavTreeDto> implements NavTreeDtoService {

    private Logger logger = LoggerFactory.getLogger(NavTreeDtoService.class);

    @Override
    public List<NavTreeDto> selectNavTreeListByPid(Integer pid) {
        logger.info("使用条件查询，查询父id下面的子节点的集合。。。");
        Example example = new Example(NavTreeDto.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andCondition("pid = ",pid);
        List<NavTreeDto> list = mapper.selectByExample(example);
        return list;
    }
}
